import request from '@/router/axios';

// 我的配送分页条件查询列表
export const getOrderDeliveryList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderDeliveryList',
    // url: 'http://192.168.2.106:8107/order/getOrderDeliveryList',
    method: 'get',
    params: query
  })
}

// 查看订单-订单信息
export const getOrderInfo = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderInfo',
    // url: 'http://192.168.2.106:8107/order/getOrderInfo',
    method: 'get',
    params: query
  })
}

// 查看订单-商品信息
export const getOrderGoodsInfo = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderGoodsInfo',
    // url: 'http://192.168.2.106:8107/order/getOrderGoodsInfo',
    method: 'get',
    params: query
  })
}

// 日志列表
export const getOrderOperateLog = (query) => {
  return request({
    url: '/api/xmbz-work/work/getOrderOperateLog',
    method: 'get',
    params: query
  })
}

// 批量签收(签收)
export const orderSign = (data) => {
  return request({
    url: '/api/xmbz-order/order/orderSign',
    // url: 'http://192.168.2.11:8107/order/orderSign',
    method: 'post',
    data
  })
}

// 根据城市ID获取上班的配送员
export const deliveries = (query) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/deliveries',
    // url: 'http://192.168.2.106:8107/orderDispatch/deliveries',
    method: 'get',
    params: query
  })
}

// 给订单分配配送员/更改配送员
export const distributeDeliveryForOrder = (data) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/distributeDeliveryForOrder',
    method: 'post',
    data
  })
}

export const batchUpdateOrderPrintingState = (data) => {
  return request({
    url: '/api/xmbz-order/order/batchUpdateOrderPrintingState',
    method: 'post',
    data
  })
}

export const distributionstate = (query) => { //好评返现审核状态
  return request({
    url: '/api/xmbz-system/dict/dictionary?code=distribution_state',
    method: 'get',
    params: query
  })
}

export function distributeDeliveryForOrderMyDistribution(data) {
  return request({
    url: '/api/xmbz-order/orderDispatch/distributeDeliveryForOrderMyDistribution',
    method: 'post',
    data
  })
}
